﻿namespace USElections.Utils
{
    using System.Collections.Generic;

    /// <summary>
    /// ItemInGroup class.
    /// </summary>
    /// <typeparam name="T">The object type.</typeparam>
    public class ItemInGroup<T> : List<T>
    {
        #region Constructor
        /// <summary>
        /// Initializes a new instance of the ItemInGroup class.
        /// </summary>
        /// <param name="category">The category.</param>
        public ItemInGroup(string category)
        {
            this.Key = category;
        }
        #endregion

        #region Public properties
        /// <summary>
        /// Gets or sets the Key.
        /// </summary>
        public string Key { get; set; }

        /// <summary>
        /// Gets a value indicating whether the group has items.
        /// </summary>
        public bool HasItems
        {
            get
            {
                return Count > 0;
            }
        }
        #endregion
    }
}
